﻿
using System;

namespace BingleMaps.ViewModels
{
	public class ViewModelBase : GalaSoft.MvvmLight.ViewModelBase
	{
		public bool SetProperty<T>(ref T property, T value, string name)
		{
			return SetProperty(ref property, value, name, (p1, p2) => Equals(p1, p2));
		}

		public bool SetProperty<T>(ref T property, T value, string name, Func<T, T, bool> comparer)
		{
			if (comparer(property, value)) return false;
			property = value;
			RaisePropertyChanged(name);
			return true;
		}
	}
}
